package com.ruoyi.channel.service.impl;

import java.util.List;
import java.util.Map;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.db.mapper.ChannelCountPvInfoMapper;
import com.ruoyi.db.domain.ChannelCountPvInfo;
import com.ruoyi.channel.service.IChannelCountPvInfoService;

/**
 * 渠道统计pv信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-07-31
 */
@Service
@DataSource(DataSourceType.SLAVE)
public class ChannelCountPvInfoServiceImpl implements IChannelCountPvInfoService 
{
    @Autowired
    private ChannelCountPvInfoMapper channelCountPvInfoMapper;

    /**
     * 查询渠道统计pv信息
     * 
     * @param id 渠道统计pv信息主键
     * @return 渠道统计pv信息
     */
    @Override
    public ChannelCountPvInfo selectChannelCountPvInfoById(Long id)
    {
        return channelCountPvInfoMapper.selectChannelCountPvInfoById(id);
    }

    /**
     * 查询渠道统计pv信息列表
     * 
     * @param channelCountPvInfo 渠道统计pv信息
     * @return 渠道统计pv信息
     */
    @Override
    public List<ChannelCountPvInfo> selectChannelCountPvInfoList(ChannelCountPvInfo channelCountPvInfo)
    {
        return channelCountPvInfoMapper.selectChannelCountPvInfoList(channelCountPvInfo);
    }

    /**
     * 查询渠道统计pv信息列表
     *
     * @param channelCountPvInfo 渠道统计pv信息
     * @return 渠道统计pv信息
     */
    @Override
    public List<Map<String, Object>> selectChannelCountPvInfoMapList(ChannelCountPvInfo channelCountPvInfo)
    {
        return channelCountPvInfoMapper.selectChannelCountPvInfoMapList(channelCountPvInfo);
    }

    /**
     * 新增渠道统计pv信息
     * 
     * @param channelCountPvInfo 渠道统计pv信息
     * @return 结果
     */
    @Override
    public int insertChannelCountPvInfo(ChannelCountPvInfo channelCountPvInfo)
    {
        channelCountPvInfo.setCreateTime(DateUtils.getNowDate());
        return channelCountPvInfoMapper.insertChannelCountPvInfo(channelCountPvInfo);
    }

    /**
     * 修改渠道统计pv信息
     * 
     * @param channelCountPvInfo 渠道统计pv信息
     * @return 结果
     */
    @Override
    public int updateChannelCountPvInfo(ChannelCountPvInfo channelCountPvInfo)
    {
        return channelCountPvInfoMapper.updateChannelCountPvInfo(channelCountPvInfo);
    }

    /**
     * 批量删除渠道统计pv信息
     * 
     * @param ids 需要删除的渠道统计pv信息主键
     * @return 结果
     */
    @Override
    public int deleteChannelCountPvInfoByIds(Long[] ids)
    {
        return channelCountPvInfoMapper.deleteChannelCountPvInfoByIds(ids);
    }

    /**
     * 删除渠道统计pv信息信息
     * 
     * @param id 渠道统计pv信息主键
     * @return 结果
     */
    @Override
    public int deleteChannelCountPvInfoById(Long id)
    {
        return channelCountPvInfoMapper.deleteChannelCountPvInfoById(id);
    }

    @Override
    public List<Map<String, Object>> selectChannelCountList(ChannelCountPvInfo channelCountPvInfo) {
        return channelCountPvInfoMapper.selectChannelCountList(channelCountPvInfo);
    }

    @Override
    public int deleteChannelCountPvInfoByDateInfo(String dateInfo) {
        return channelCountPvInfoMapper.deleteChannelCountPvInfoByDateInfo(dateInfo);
    }
}
